package com.authine.cloudpivot.ext.enums;

/**
 * 订单商品退货状态
 * 适用范围【t_order_goods_returns.origin_old_status】
 * @author Kris
 */

public enum OrderGoodsRefundStatusEnum {

    ALL(0, "全部"),
    RETURN(1,"待退货"),
    RETURN_TO_P(2, "待退货给平台"),
    RETURNED(3, "已退货"),
    RETURNED_TO_P(4, "已退货给平台"),
    REFUNDED(5, "已退款"),//商品仅退款
    REFUND_APPROVING(6, "审批中"),
    DONE(7, "已完成");//商品退货退款

    public Integer id;
    public String text;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getText() {
        return text;
    }

    public void setText(String text) {
        this.text = text;
    }

    OrderGoodsRefundStatusEnum(Integer id, String text) {

        this.id = id;
        this.text = text;
    }

    public static OrderGoodsRefundStatusEnum get(Integer code) {

        for (OrderGoodsRefundStatusEnum c : OrderGoodsRefundStatusEnum.values()) {
            if (c.id.toString().equals(code.toString())) {
                return c;
            }
        }
        return null;
    }

    @Override
    public String toString() {
        return text;
    }
}
